Fix subfield pushdown arg index for selecting entire struct column#25471
Merged
kevintang2022 merged 1 commit intoprestodb:masterfrom Jul 2, 2025
Merged
Fix subfield pushdown arg index for selecting entire struct column#25471kevintang2022 merged 1 commit intoprestodb:masterfrom
kevintang2022 merged 1 commit intoprestodb:masterfrom
Conversation
Collaborator
|
This pull request was exported from Phabricator. Differential Revision: D76869401 |
rschlussel
reviewed
Jul 1, 2025
Contributor
rschlussel
left a comment
There was a problem hiding this comment.
Can you also add a release note?
Summary: Currently, seeing index out of range errors for cases when a struct column is read, but none of its subfields are referenced Reviewed By: rschlussel Differential Revision: D76869401
aacc0e6 to
9634a59
Compare
rschlussel
approved these changes
Jul 2, 2025
This was referenced Jul 4, 2025
This was referenced Jul 24, 2025
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary: Currently, seeing index out of range errors for cases when a struct column is read, but none of its subfields are referenced
Reviewed By: rschlussel
Differential Revision: D76869401
Test Plan
For cases when the struct column does not have any of its subfields referenced, the fb_reshape_row expression is passed into the toSubfield method

When a subfield is actually read in the query, a DEREFERENCE is passed in

In the dereference case, the elements immutablelist builder will have at least one element. In the first case, the list builder will be empty
Manual tests:
Verifier query that caught the empty subfields bug:
0.294-edge2: 20250618_024807_00003_snxkc. Failed with index out of range
0.294-20250618.023458-171: 20250618_025504_00004_29vsz succeed
Arg pushdown
20250618_025745_00008_29vsz correct query plan with pushed down subfield
20250618_025948_00010_29vsz query plan with non relevant function
20250618_030040_00011_29vsz expected plan
Release Notes
Please follow release notes guidelines and fill in the release notes below.